<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
        <title>Create Course</title>
    </h:head>
    <h:body>
        <h:message style="color: red" for="form"/>
        <h:form id="form">
            <p>
                <h:message style="color: red" for="name" />
                CourseName: <h:inputText id="name" required="true" value="#{courseBean.name}"></h:inputText>
            </p>
            <p>
                <h:message style="color:red" for="identifier"/>
                Identifier: <h:inputText id="identifier" required="true" value="#{courseBean.identifier}"></h:inputText>
                                       
            </p>
             <p>
                 Degree Programs<h:selectManyCheckbox value="#{courseBean.degreeProgram}">
                     <f:selectItems value="#{courseBean.allDegreePrograms}" var="dp"
                                    itemLabel="#{dp.identifier}" itemValue="#{dp.identifier}" />
                </h:selectManyCheckbox>
            </p>
          <!--  <p>
               Course Outcomes<h:selectManyCheckbox value="#{courseBean.courseOutcomes}">
                    <f:selectItems value="#{courseBean.allCourseOutcomes}" var="co"
                                   itemLabel="#{co.identifier2}" itemValue="#{co.identifier2}" />
                </h:selectManyCheckbox>
            </p>-->
            <p>
                <h:message style="color:red" for="coursecoordinator"/>
                CourseCoordinator: 
                <h:selectOneRadio id="coursecoordinator"
                      value="#{courseBean.courseCoordinator}">
                    <f:selectItems value="#{courseBean.userList}" var="cc" 
                                   itemLabel="#{cc.username}" itemValue="#{cc.username}"/>
                </h:selectOneRadio>                       
            </p>
           <p>
               Alternate Course Coordinator<h:selectManyCheckbox value="#{courseBean.altCourseCoordinators}">
                   <f:selectItems value="#{courseBean.userList}" var="alt"
                                  itemLabel="#{alt.username}" itemValue="#{alt.username}" />
                </h:selectManyCheckbox>
            </p>
            <p>
                <h:commandButton id='submit' value="Submit" action="#{courseBean.createCourse()}" />
            </p>
        </h:form>
    </h:body>
</html>

